home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / bash_completion.d / brctl < prev    next >
Text File  |  2009-04-02  |  831b  |  45 lines

  1. # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
  2. # ex: ts=8 sw=8 noet filetype=sh
  3. #
  4. # bash completion for brctl
  5.  
  6. have brctl &&
  7. _brctl()
  8. {
  9.     local cur command
  10.  
  11.     COMPREPLY=()
  12.     cur=`_get_cword`
  13.     command=${COMP_WORDS[1]}
  14.  
  15.     case $COMP_CWORD in
  16.         1)
  17.             COMPREPLY=( $( compgen -W "addbr delbr addif delif \
  18.                 setageing setbridgeprio setfd sethello \
  19.                 setmaxage setpathcost setportprio show \
  20.                 showmacs showstp stp" -- $cur ) )
  21.             ;;
  22.         2)
  23.             case $command in
  24.                 show)
  25.                     ;;
  26.                 *)
  27.                     COMPREPLY=( $( compgen -W "$(brctl \
  28.                         show | sed '1d' | \
  29.                         awk '{print $1}' )" -- $cur ) )
  30.             esac
  31.             ;;
  32.         3)
  33.             case $command in
  34.                 @(add|del)if)
  35.                     _configured_interfaces
  36.                     ;;
  37.                 stp)
  38.                     COMPREPLY=( $( compgen -W 'on off' -- $cur ) )
  39.                     ;;
  40.             esac
  41.             ;;
  42.     esac
  43. } &&
  44. complete -F _brctl $default brctl
  45.